//
// Created by wxd on 2025/8/5.
// 定义几何接口层
//

#pragma once

#ifndef ENGINE_IGEOMETRY_H
#define ENGINE_IGEOMETRY_H

#include <glad/glad.h>
#include <vector>
#include "glm/glm.hpp"
#include <string>

class IGeometry {
public:
    enum VBOType {
        NONE,
        POS,
        COL,
        UV,
        NORMAL,
    };


    virtual ~IGeometry() = default;

    virtual GLuint getVAOID() const = 0;
    virtual GLuint getVBO(VBOType vboType) = 0;
    virtual GLuint getEBOID() const = 0;
    virtual size_t getIndicesCount() const = 0;
    virtual size_t getVerticesCount() = 0;

    virtual void initVAO() = 0;
    virtual void initEBO(const std::vector<unsigned int>& indices, GLenum dataType) = 0;
    virtual void initVBO(const std::vector<float>& data, VBOType vboType, int comp, int location, GLenum dataType) = 0;

    virtual void bindVBO(VBOType vboType) = 0;

    virtual void draw() = 0;

    virtual void setPos(const int location, const std::vector<glm::vec2>& pos) = 0;
    virtual void setPos(const int location, const std::vector<glm::vec3>& pos) = 0;
    virtual void setPos(const int location, const std::vector<glm::vec4>& pos) = 0;
    virtual void setCol(const int location, const std::vector<glm::vec3>& cols) = 0;
    virtual void setCol(const int location, const std::vector<glm::vec4>& cols) = 0;
    virtual void setUV(const int location, const std::vector<glm::vec2>& uvs) = 0;
    virtual void setNormal(const int location, const std::vector<glm::vec3>& normals) = 0;
    virtual void setIndices(const std::vector<glm::uvec3>& indices) = 0;

    virtual std::string getTraceId() const = 0;
};

#endif //ENGINE_IGEOMETRY_H
